package com.crealth.handler;

import java.util.concurrent.ConcurrentLinkedDeque;
import com.crealth.msg.NetMessageData;

public class RequestMsgQueue {
	/*
	private static ExecutorService requestExecutor = null;
	
	public static void setRequestExecutor(ExecutorService executor) {
		requestExecutor = executor;
	}
	*/
	
	private static ConcurrentLinkedDeque<NetMessageData> requestDeque = 
			new ConcurrentLinkedDeque<NetMessageData>();
	
	public static void addMsgToQueue(NetMessageData sendMsg) {
		if (sendMsg == null) {
			return;
		}
		requestDeque.addLast(sendMsg);
		//requestExecutor.execute(new RequestMsgThread());
	}
	
	public static NetMessageData getRequestMsg() {
		NetMessageData msg = requestDeque.pollFirst();
		
		return msg;
	}
	
	
}
